Generalized Toffoli Gate Decomposition Using Ququints: Towards Realizing Grover’s Algorithm with Qudits

Qubits, which are the quantum counterparts of classical bits, are used as basic information units for quantum information processing, whereas underlying physical information carriers, e.g., (artificial) atoms or ions, admit encoding of more complex multilevel states—qudits. Recently, significant attention has been paid to the idea of using qudit encoding as a way for further scaling quantum processors. In this work, we present an efficient decomposition of the generalized Toffoli gate on five-level quantum systems—so-called ququints—that use ququints’ space as the space of two qubits with a joint ancillary state. The basic two-qubit operation we use is a version of the controlled-phase gate. The proposed N-qubit Toffoli gate decomposition has O(N) asymptotic depth and does not use ancillary qubits. We then apply our results for Grover’s algorithm, where we indicate on the sizable advantage of using the qudit-based approach with the proposed decomposition in comparison to the standard qubit case. We expect that our results are applicable for quantum processors based on various physical platforms, such as trapped ions, neutral atoms, protonic systems, superconducting circuits, and others.


Introduction
The concept of quantum computing relies on the idea of manipulating complex (entangled, many-body) quantum states in order to solve computational problems that are beyond the capabilities of computing devices based on classical principles [1][2][3]. The key problem, however, is to find or engineer a suitable physical platform that allows manipulation and high-efficient control when the system is scaled. One of the basic concepts, which is at the heart of the digital quantum computing model [4], is to present physical systems as qubits-two-level quantum systems. The complexity of defining a general entangled multi-qubit state is exponential in terms of the number of qubits; indeed, a system of n entangled qubits may require up to 2 n complex numbers to describe its state [5] (this is in contrast to the classical domain, where a single string of n zeros and ones is sufficient to describe the state of n bits). This 'quantum complexity' [6] can be considered as the origin of the quantum computational advantage in solving various problems, such as simulating quantum systems [7] and prime factorization [8].
Recent experimental progress has been demonstrated with physical platforms of various nature including superconducting circuits [9][10][11], semiconductor quantum dots [12][13][14], quantum light [15,16], neutral atoms [17][18][19][20], and trapped ions [21][22][23] (for a review, see Ref. [24]). Such setups have been used for testing quantum computational advantage [10,11,15,16], quantum simulation [17][18][19]21,22], and prototyping various quantum algorithms (see e.g., Refs. [9,20,23,25]). However, the computational capabilities of existing prototypes of quantum computing devices are substantially limited. The reason behind this is the fact that scaling quantum systems with respect to the number of qubits without degrading the quality of control over them remains challenging. A clear indication of this fact is that the fidelities of quantum gates in the case of isolated few-qubit systems are much greater than in the case of intermediate-scale systems. Although there are no known fundamental obstacles preventing further scaling quantum devices, this task seems to be non-trivial. Various approaches, such as new qubit architectures (for example, see Refs. [26][27][28] for a new type of the currently used superconducting transom qubits [9][10][11]) and computational models [29], have been investigated.
One may also note that underlying physical platforms for quantum computingfor example, trapped ions and atoms-allow one to encode multiple computational states using a single physical information carrier. In other words, such systems can be used for realizing qudit-based quantum processors (d-dimensional quantum systems, d > 2; so, the corresponding scaling of the computational space is d N ). The idea of using multi-level (or multi-state) quantum systems has been known for decades [30]. Numerous works on quantum computing with qudits during the last decades have confirmed the promise of this approach . Besides quantum computing, qudit-based systems offer certain perspectives in quantum teleportation [57] and quantum communications [74,75], as well as open up opportunities for uncovering fundamental concepts of quantum mechanics [50,54,76]. It is interesting to note that the first realization of two-qubit gates has used two qubits stored in the degrees of freedom of a single trapped ion, i.e., with the use of a qudit [77]. One may specifically note demonstrations of multi-qubit processors based on trapped ions [78,79], superconducting circuits [80][81][82], and optical systems [72].
A central idea of qudit-based quantum information processing is finding a trade-off between increasing complexity of controlling the system and potential advantages, for example, in realizing quantum algorithms. Recent experimental results have demonstrated that it is fairly straightforward to control qudit systems with d up to 7 [78,79] with high enough fidelity using a single laser and acousto-optic modulator. There are two basic approaches of how additional levels of quantum systems can be used. The first idea is to use qudit for substituting ancillas [46,48,56,61,62,73,83,84], which allows decreasing the number of physical qubits that are required for executing quantum circuits. Following this method, the N-qubit Toffoli gate was realized with 2N − 3 qubit-qudit gates on the photonic quantum circuit [61]. Although the reduction of the number of qubit-qudit interactions is significant, the experiment configuration, which required an N-dimensional qudit connected with N − 1 qubits, is difficult to scale with an increasing number of qubits.
Another possible approach is to consider the qudit's space as a space of multiple qubits [32][33][34]51,52]. In this consideration, a reduction in the number of operations can be also achieved, but it depends on the mapping of qubits' space onto qudits' space. As it has been noted, these approaches can be efficiently combined (this problem has been discussed in general terms in Ref. [85]). However, practically relevant cases showing advantages of the combinations of these approaches and their applications in realizing quantum algorithms require additional studies.
In this work, we study a model of a ququint-based (d = 5) quantum processor that involves the decomposition of multi-qubit systems into ququint subsystems, as well as the use of ququints' higher levels as ancillas. For this model, we describe possible mapping of qubits' space onto ququints' space. Then, we show how one-qubit gates and the generalized N-qubit Toffoli gate can be realized in the proposed setup. Finally, we consider how the proposed model is applied to quantum algorithms with a large number of multi-qubit gates. The proposed ququint-based quantum processor model allows us to implement N-qubit gates with circuits that have O(N) asymptotic depth. We apply our results for Grover's algorithm, where we indicate the sizable advantage of using the qudit-based approach with the proposed decomposition.
Our work is organized as follows. In Section 2, we consider quantum computing with qudits. Specifically, we analyze a model of a ququint-based (d = 5) quantum processor that involves the decomposition of multi-qubit systems into ququint subsystems, as well as the use of ququints' higher levels as ancillas. In Section 3, we demonstrate how one-qubit gates and the generalized N-qubit Toffoli gate can be realized in the proposed setup. In Section 4, we present the qudit-based realization of Grover's algorithm. Finally, we conclude in Section 5.

Ququint Processor
There are two basic approaches for using additional resources of qudits for realizing more efficient quantum computing. We note that the efficiency here can be understood in two aspects. The first is that we would like to minimize the number of physical qubits that are used to run quantum circuits. Additional complications in realizing quantum circuits come from the fact that additional ancilla qubits are required when one would like to implement N-qubit gates [86]. For example, efficient implementation of N-qubit Toffoli gates is essential for Grover search [87,88]. One can then use additional levels of qudits for substituting ancillas [46,48,56,61,62,73,83,84], which allows decreasing the number of physical qubits required for executing quantum circuits.
Another idea is to consider the qudit's space as a space of multiple qubits [32][33][34]51,52]. A reduction in the number of operations can be also achieved but it depends on the mapping of qubits' space onto qudits' space. As it has been noted, these approaches can be efficiently combined (this problem has been discussed generally in Ref. [85]). However, practically relevant cases showing advantages of the combinations of these approaches and their applications in realizing quantum algorithms require additional studies. Below, we consider an important particular case for combining these approaches.

Ququint as Two Qubits and Ancillary State
Five-dimensional state space of a ququint Q can be considered as a joint space of two qubits, a and b, accompanied with an ancillary state. The corresponding qubit-to-qudit mapping can be represented as follows: where |n Q with n = 0, . . . , 4 denotes basis states of ququint Q; |m a(b) with m = 0, 1 denotes computational basis states of qubit a(b), which is embedded in Q; and |anc denotes the ancillary state. Below, we assume that the state |anc serves only as a 'pure' ancilla for implementing multi-qubit gates: according to the designed decomposition, this level is populated only during the realization of a multi-qubit gate (it is initialized in the state |0 and it is also in this state at the final step of implementing quantum circuits). The introduced representation of ququint's space allows one to reduce the required number of physical systems and two-qudit gates in multi-qubit gate decomposition, as we demonstrate in the next section.
In analogy with the idea of qubit-based digital quantum computations (see above), we assume that we can perform any desirable single-qubit unitary operation U ∈ U(2) on an arbitrary pair of levels i and j in ququint Q. The resulting unitary operation, denoted U (i,j) Q , takes the following form: where 1 ⊥ i,j stands for a projector on a three-dimensional orthogonal complement of the subspace spanned by |i Q , |j Q . According to mapping (1), applying a single-qubit gate to qubits a and b, respectively, leads to the following single-qudit realizations: (here and after all unspecified elements in matrices are zeros).
One of the main features of considering the ququint's space as a space of two qubits with ancillary level is the ability to implement two-qubit gates between qubits a and b using single-ququint gates only. A controlled-phase gate between a and b can be realized with a single-qudit operation where Z = |0 0| − |1 1| is a standard Pauli matrix. We note that other realizations, e.g., Z (1,3) Q , are possible. We note that any restricted, yet connected, coupling map between levels inside a qudit is enough to implement the unitary operation on an arbitrary pair of levels [58,89]. For example, in order to couple levels |0 Q and |2 Q , one can use transitions |0 Q ↔ |1 Q and |1 Q ↔ |2 Q , even in the case where transition |0 Q ↔ |2 Q is forbidden due to selection rules. Moreover, in actual existing experimental setups, transitions within a given coupling graph can be implemented with a single laser and acousto-optic modulator [78].
As a two-ququint gate, we consider the CZ i↔j Q 1 Q 2 gate, which applies phase factor −1 to the state |ij Q 1 Q 2 of two ququints Q 1 and Q 2 : We note that this two-qudit gate can be realized via Rydberg blockade neutral atom-based [90] qudits, and via the common quantized motion mode in an ion-based platform [91]. On the basis of CZ gates, one can construct more complicated gates, such as the CX i→k, Q 1 Q 2 gate, which is defined as where H = 2 −1/2 ∑ p,r=0,1 (−1) pr |p r| is a standard Hadamard gate (see also Figure 1). The idea of the two-ququint CX i→k, Q 1 Q 2 gate is similar to the idea of the qubit CX gate: It swaps states |k Q 2 and | Q 2 when Q 1 is in the state |i Q 1 . gate. The corresponding target qudit is denoted by the white circle with an arrow between k and . The CX i→k, Q 1 Q 2 gate exchanges populations between levels of the |k and | states of the target qudit, given that the control qudit is in the state |i . On the right-hand side of the image, the gate with two connected black-painted circles corresponds to the controlled-phase CZ i↔ Q 1 Q 2 operation, which applies a phase factor −1 to the state of two ququints |i Q 1 Q 2 and leaves other states unchanged. Single-qudit H (k, ) gates denote two-dimensional Hadamard transformations realized at levels |k and | of Q 2 .
To conclude this section, we note that each ququint Q can be also used for embedding a single qubit a accompanied with three ancillary levels. In this case, the qubit-to-qudit mapping takes the form where |anc and |anc denote new auxiliary levels.
We assume that each qudit can be measured in a computational basis. From the viewpoint of embedded qubit(s), this measurement corresponds to the computational basis measurement over one or two qubits. The correspondence is given by mapping (1) or (8). Below, we consider both mappings (1) and (8) within decomposition of the generalized N-qubit Toffoli gate.

Toffoli Gate Implementation
The generalized N-qubit Toffoli gate C N−1 X (t) , acting on qubits q 1 , . . . , q N , flips a particular target qubit state of q t if and only if all the other N − 1 control qubits are in the state |1 [86]. This gate can be realized with a 'symmetric' multi-controlled phase gate where b i = 0, 1 denotes qubit basis states. One can obtain C N−1 X (t) from C N−1 Z by surrounding the target qubit t with single-qubit Hadamard gates. In what follows, we consider a ququint-based implementation C N−1 Z.
To clarify our consideration, we discuss the most simple cases of embedding qubits that are effected by the C N−1 Z gate into qudits. For even N, we consider N qubits embedded in N/2 ququints according to mapping (1). For odd N, we consider N − 1 qubits embedded in (N − 1)/2 ququints, and the remaining qubit embedded in an additional ququint. Two situations are possible: (i) the additional ququint is used for storing the single Nth qubit only (i.e., mapping (8) is used); (ii) there exists an additional neighboring qubit, embedded in this ququint, that is involved in the whole qubit circuit but not involved in the decomposed C N−1 Z gate (mapping (1) is used). These three cases require separate treatments (see Table 1).
Let us start with a decomposition of the C 2 Z gate (N = 3). For this purpose, we embed qubits q 1 and q 2 into the single ququint Q 1 and consider two variants of embedding q 3 into Q 2 . If q 3 is embedded in Q 2 according to mapping (8), the implementation of C 2 Z reduces to realization of the CZ (3↔1) Q 1 Q 2 gate, since |31 Q 1 Q 2 is mapped to |111 q 1 q 2 q 3 . In the case of mapping (1) for Q 2 (we assume that q 2 corresponds to a in (1)), we apply two gates: CZ 3↔2 Q 1 Q 2 and CZ 3↔3 Q 1 Q 2 . This overhead in the number of gates is due to necessity to preserve the state of the second qubit embedded in Q 2 . We note that this doubling of the number of gates meets us in every decomposition of C N−1 Z with odd N and the appearance of the neighboring qubit in the last [(N + 1)/2]th ququint. Table 1. C N−1 Z gate implementation on ququints for N = 3, . . . , 6 with CZ i↔j and CX i→k, gates for two possible variants of mapping for the 'bottom' ququint. Labeling of gates is the same as in Figure 1.
Following this idea, the implementation of C 3 Z on two ququints Q 1 and Q 2 is realized via CZ 3↔3 Q 1 Q 2 gate. To implement a five-qubit C 4 Z gate, we use the following trick. We put the information about whether the four qubits q 1 , . . . , q 4 , embedded in Q 1 and Q 2 , are in unit state |1 . . . 1 q 1 ...q 4 in the ancillary state of Q 2 . It can be realized by applying the CX 3→3,4 Q 1 Q 2 gate. Then, we apply the controlled-phase rotation from the ancillary state of Q 2 to the state of q 5 , embedded in Q 3 . Depending on the type of mapping used for Q 3 , we apply a single two-ququint gate CZ 4↔1 Q 2 Q 3 or two two-ququint gates CZ 4↔2 Q 2 Q 3 and CZ 4↔3 Q 2 Q 3 . Note that the phase factor is acquired if and only if all five qubits are initially in the unit state. At the final step, the state Q 1 and Q 2 is restored to the original state by 'uncomputation' with the CX 3→3,4 Q 1 Q 2 gate. One can see that the key idea of this decomposition is that we store information about two qubits in the first four ququint levels, and the highest ququint state |4 ≡ |anc is used instead of an ancilla to store temporary data.
The decomposition of C 4 Z allows us to obtain a decomposition for the C N−1 Z gate with N ≥ 6 (see Figure 2). The key idea is the same. We apply a sequence CX 3→3,4  (1) is used. Finally, the ladder of CX gates is implemented in reverse order. In the result, we obtain a circuit consisting of N − 3 or N − 2 two-ququint gates that have O(N) asymptotic depth.

Application to Grover's Algorithm
The method proposed in the present work to construct the generalized Toffoli gate can be applied to any quantum algorithm that contains multi-qubit gates. A clear example is Grover's algorithm [87,88] for searching a 'hidden' bitstring ω ∈ {0, 1} n , s.t. f (ω) = 1, where a 'black box' function f : {0, 1} n → {0, 1} is known to take a unit value only on one element. Here, n is some integer value, which defines a domain for f and determines the complexity of the problem. Grover's algorithm typically requires O(2 n/2 ) queries to an oracle U f : |x |t → |x | f (x) ⊕ t , where x ∈ {0, 1} n , t ∈ {0, 1}, and ⊕ stands for an exclusive OR (XOR) operation. Each query is followed by an n-qubit diffusion operator where 1 is a 2 n -dimensional identity matrix and |sym := 2 −n/2 ∑ x∈{0,1} n |x . Notably, the diffusion operator can be reduced to a C n−1 Z gate surrounded by single-qubit H and X = |0 1| + |1 0| gates. The explicit circuit diagram for finding item ω = 10101 (n = 5) items is shown in Figure 3. To examine the efficiency of the proposed decomposition, we compute a two-particle gates count for Grover's algorithm implementations with several approaches for the decomposition of multi-qubit gates, where by 'two-particle gate' we mean a gate between two physical systems, which are used as qudits. This term is convenient to use as we further compare the total amount of operations between physical systems with different number of levels in the implementation of Grover's algorithm. For the comparison, we chose three approaches to the decomposition of multi-qubit gates: qubit-based decomposition with additional ancillary qubits [36]; qutrit-based decomposition, where higher levels of qutrits act as ancillas [73,92]; and the ququint-based decomposition that is proposed above.

Diffusion operator Oracle
For all described decomposition methods, two-qudit gate counts, resulting from the implementation of Grover's algorithm on 2 to 10 qubits, are plotted in Figure 4. We note that the plotted data take into account an increase in the number of iterations (Grover's step) and an increase in the number of involved qubits.
The first considered method [36] relies on using only qubits for decomposition of the multi-qubit gate (square symbols line in Figure 4). For this reason, to achieve linear scaling of the required number of two-qubit gates in the decomposition, it is necessary to use additional qubits as ancillas-namely, to decompose n-qubit controlled gate, one needs to use n − 2 additional physical systems. Using them, the number of required two-qubit gates to implement the n-qubit gate is equal to 12n − 23. . Two-qudit gate counts for implementations of n-qubit Grover's algorithm (n is from 2 to 10) with the qubit-based decomposition method [36], which requires n − 2 ancillary qubits for n-qubit gate decomposition and has linear scaling; qutrit-based decomposition method [73]; and the proposed ququint-based decomposition method. Plotted data take into account an increase in the number of Grover's steps in quantum circuits with an increase in the number of involved qubits.
Qutrit-based decomposition [73,92] provides a significantly lower constant in a linear scaling of the required number of two-particle gates in the n-qubit gate decomposition (circle symbols in Figure 4). There is no need to use additional physical qubits within this decomposition, owing to the presence of the third level in qutrit and its use as an ancillary state. The main idea behind qutrit-based decomposition is to 'check' the states of each pair of qubit sequentially, leaving the second qutrit in the pair in state |1 if and only if both qutrits are in the state |1 . Then, if this condition is satisfied, required controlled operation (CZ or CX) is applied to the last pair of qutrits. It can be seen that the circuit of this decomposition has a V-ladder-like architecture and consists of 2n − 3 two-particle gates for the n-qubit gate.
The third decomposition, which is considered for comparison, is the proposed ququint-based decomposition in this paper (triangle symbols in Figure 4). As discussed earlier, the main feature of this method is that the reduction in the number of required two-particle gates is provided by embedding two qubits in a single ququint together with the use of the highest level in ququint as an ancillary state. Such a combined approach to the use of ququints' space makes the constant in the linear scaling number of two-particle gates even lower than in qutrit-based decomposition.
As we can see from Figure 4, the use of ququints allows us to reduce the number of two-qudit gates in the implementation of Grover's algorithm by a thousand times compared to its only-qubit implementation if the number of items for search is greater than n = 8. However, on a small number of required qubits, the ququint-based method and the method from Ref. [92] have almost the same efficiency. The reason for this is that the contribution from information compression from two qubits into one physical ququint grows with the number of required qubits in the algorithm. For this reason, the ququintbased decomposition of multi-qubit gates is optimal for algorithms with a sufficiently large (n > 4) number of required qubits.

Conclusions and Outlook
We have demonstrated that a sizable reduction in the number of gates in the quantum circuit can be achieved by considering the ququint's space as two qubits and a joint ancillary state. We have presented a new decomposition of the generalized N-qubit Toffoli gate that uses no additional ancillary qubits and requires a linear number of two-particle gates. The new decomposition can be exploited in algorithms with multi-qubit gates and error correction schemes to increase the total circuit fidelity. We demonstrate its efficiency on the Grover's search algorithm, which is a good illustrative example since it requires multi-qubit gates in both parts of an oracle and the diffusion operator of the algorithm. The crucial point is that the resulting number of two-particle gates required for implementing its circuit with ququints appears considerably smaller than the one in a straightforward qubit-based implementation.
In the current contribution, we have considered a general theoretical approach, leaving a detailed design for particular physical platforms for future works. Here, we only sketch the way it can be achieved. First, one has to consider a particular coupling map between levels in given qudits. A decomposition of single-qudit gates down to operations on allowed transitions has to be applied [78,89]. Second, a transformation of an employed two-qudit controlled-phase gate on particular native two-qudit operations is required; this can be realized via single-qudit gates.
Although manipulating with additional levels of qudits faces additional experimental problems, recent works (see, e.g., Refs. [72,[78][79][80][81]) have shown dramatic progress in increasing quality of operations with qudits based on various physical platforms. Both single-qudit and two-qudit gates nowadays have achieved fidelities, which are comparable with fidelities demonstrated on two-level systems. We believe that combining these experimental achievements with the presented approach for decreasing the number of two-particle gates can significantly improve the resulting quality of quantum algorithms implementation.
We also note that in order to extend our approach for three qubits embedded with a single ancillary level into a single qudit, one requires qudits of dimension d = 2 3 + 1 = 9. This is above the typical dimensionality of currently considered qudit-based platforms [78][79][80][81]. Investigation of qudits with d ≥ 9 together with possible accompanying practical challenges is an important promising topic for further research.

Institutional Review Board Statement: Not applicable.
Data Availability Statement: All data available upon the reasonable request.